import { IPSCtrlMsg } from './ipsctrl-msg';
import { IPSCtrlMsgItem } from './ipsctrl-msg-item';
import { PSModelObjectImpl } from '../psmodel-object-impl';

export class PSCtrlMsgImpl extends PSModelObjectImpl implements IPSCtrlMsg {
  get codeName(): string {
    return this.M.codeName;
  }

  get dynaModelFilePath(): string {
    return this.M.dynaModelFilePath;
  }

  get memo(): string {
    return this.M.memo;
  }

  get msgModel(): string {
    return this.M.msgModel;
  }

  get name(): string {
    return this.M.name;
  }

  protected psctrlmsgitems: IPSCtrlMsgItem[] | null = null;

  getPSCtrlMsgItems(): IPSCtrlMsgItem[] | null {
    if (this.psctrlmsgitems == null) {
      this.psctrlmsgitems = this.fillChildListModel(this.M.getPSCtrlMsgItems, 'res.IPSCtrlMsgItem') as IPSCtrlMsgItem[];
    }
    return this.psctrlmsgitems;
  }

  get psCtrlMsgItems(): IPSCtrlMsgItem[] | null {
    return this.getPSCtrlMsgItems();
  }

  findPSCtrlMsgItem(objKey: any): IPSCtrlMsgItem | null {
    return this.getPSModel5('res.IPSCtrlMsgItem', this.getPSCtrlMsgItems(), objKey) as IPSCtrlMsgItem;
  }

  get userCat(): string {
    return this.M.userCat;
  }

  get userTag(): string {
    return this.M.userTag;
  }

  get userTag2(): string {
    return this.M.userTag2;
  }

  get userTag3(): string {
    return this.M.userTag3;
  }

  get userTag4(): string {
    return this.M.userTag4;
  }

  get cls(): string {
    return 'PSCtrlMsgImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'res.IPSCtrlMsg') return true;
    return super.instanceof(cls);
  }
}
